function Person0(name) {
    this.name = name;
}
Person0.prototype.say = function () {
    console.log('hi');
}

class Person {
    constructor(name) {
        this.name = name;
    }
    say() {
        console.log(`hi ${ this.name}`);
    }
    static create(name) {
        return new Person(name);
    }
}

const p = new Person('lala');
p.say();

class Student extends Person {
    constructor(name, number) {
        super(name);
        this.number = number;
    }
    hello () {
        super.say();
        console.log(`age is ${ this.number }`)
    }
}

const s = new Student('hhj', 19);
s.hello();


